int arr[] = {0,7,6,5,4,3,2,1};
int arrLen = 7;
Swap(int * p1,int * p2)
{
    int t = *p1;
    *p1 = *p2;
    *p2 = t;
}
void Sort(int *arr,int l,int r)
{
  if(l>r)
    return;
  int i = l;
  int j = r;
  int* n = arr+l;
  while(i!=j)
  {
    while(!((*(arr+j))<*n)&&i<j)
      j--;
    while(!((*(arr+i))>*n)&&i<j)
      i++;
    if(i<j)
    Swap(arr+i,arr+j);
  }
  Swap(n,arr+i);
  Sort(arr,l,i-1);
  Sort(arr,i+1,r);
}